<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>抢购</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script type="text/javascript">
        axios({
            method: 'POST',
            url: '/purchase',
            params: {
                'userId': 1,
                'productId': 1,
                'quanity': 3
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        }).then(function (response) {
            console.log(response);
            let result = response.data;
        }).catch(function (error) {
            console.log(error);
        });
    </script>
</head>
<body>

</body>
</html>